using System;

namespace Gonte.Validation
{
    public class ValidationError
    {
        public ValidationError(string property, string error)
        {
            if (string.IsNullOrEmpty(property))
            {
                throw new ArgumentNullException("property");
            }

            if (string.IsNullOrEmpty(error))
            {
                throw new ArgumentNullException("error");
            }

            property_ = property;
            error_ = error;
        }

        public override string ToString()
        {
            return string.Format("Validation failed for property: {0} - {1}", property_, error_);
        }

        #region Properties

        public string Property
        {
            get { return property_; }
            //set { property_ = value; }
        }
        
        public string Error
        {
            get { return error_; }
            //set { error_ = value; }
        }

        #endregion

        #region Attributes

        private string property_;
        private string error_; 

        #endregion
    }
}
